/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.lis.model.newmodel;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;

/**
 *
 * @author cxhd
 */
@SuppressWarnings("serial")
public class PpDeviceTestVal extends Model<PpDeviceTestVal> {

    public static final PpDeviceTestVal ppDeviceTestdao = new PpDeviceTestVal();

    public void saveVal(Controller con) {

        set("AGE_MIN", con.getPara("AGE_MIN"));
        set("AGE_MAX", con.getPara("AGE_MAX"));
        set("SEX", con.getPara("SEX"));
        set("VAL_MIN", con.getPara("VAL_MIN"));
        set("VAL_MAX", con.getPara("VAL_MAX"));
        set("PP_PK", con.getPara("PP_PK"));
        save();

    }

    public void updateVal(Controller con) {
        findById(con.getPara("PK"))
                .set("AGE_MIN", con.getPara("AGE_MIN"))
                .set("AGE_MAX", con.getPara("AGE_MAX"))
                .set("SEX", con.getPara("SEX"))
                .set("VAL_MIN", con.getPara("VAL_MIN"))
                .set("VAL_MAX", con.getPara("VAL_MAX"))
                .set("PP_PK", con.getPara("PP_PK"))
                .update();
    }

}
